home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / Basic / Visual Basic.60 / COMMON / TOOLS / VB / OLEMSG / TIMECARD.CLI / README.TXT next >
Encoding:
Text File  |  1996-06-15  |  5.6 KB  |  115 lines

  1. Time Card Sample
  2.  
  3. This sample application illustrates using MAPI OLE Messaging in VB
  4. applications.
  5.  
  6. OLE Messaging features illustrated:
  7. +  creating a MAPI session object and logging on
  8. +  creating new messages
  9. +  using standard message properties: subject, body, recipients,
  10.    attachments
  11. +  sending and receiving both IPM and IPC messages
  12. +  using custom fields and multi-valued fields
  13. +  browsing through messages in a folder and through folders in
  14.    personal/public folders
  15. +  using Session.AddressBook dialog
  16. +  saving address book entries between sessions
  17.  
  18. Installation:
  19. In order to use the sample, first compile the client executable 
  20. (tmcli.exe) in the client directory.
  21. Next, in file server\server.bas set the value of constant
  22. ClientExePath to the full path to the client executable (tmcli.exe).
  23. Finally, recompile the tmserv.exe.
  24.  
  25. Terminology:
  26. server app (server) - a program that keeps a list of all the users,
  27. sends out time report requests to each user on the list, and produces
  28. a summary report for all the users for a given pay period.
  29. client app (client) - a program that scans the inbox for a request
  30. from the server. If a request is found, it displays and prompts the
  31. user to fill out  a time report form.
  32. request message (request)- an IPM message sent from the server app to
  33. the users. This message contains client.exe as an attachment and
  34. report categories, number of report categories, pay period saved in
  35. the message's named properties.
  36. report message (report) - an IPC message sent from a client app to the
  37. server. This message contains all the information that request does
  38. plus number of hours user worked divided by  report categories and
  39. days of the week saved in the message's named properties.
  40. pay period - pay period for this sample is a week (Sunday through
  41. Saturday)  that is identified by the date of its Friday.
  42.  
  43. Description:
  44. The sample performs collecting of time information for hourly
  45. employees for payroll purposes. It consists of two standalone parts:
  46. a server (tmserv.exe) and a client (tmcli.exe).
  47.  
  48. Server:
  49. The main window of the server is divided into two parts: a list of
  50. users and a list of report categories. Each part has "Add" and
  51. "Remove" buttons to manipulate the contents of the corresponding list.
  52. The File menu Save command saves both user and category lists to files
  53. so that next time you start up the server they are there.
  54. The Report menu "Send Requests" command first asks list owner for a
  55. pay period and then sends requests to all the users on the list.
  56. The Report menu "Generate Report" command first asks user for a pay
  57. period and then generates a report for the given pay period.
  58. The Report menu "Clean Up" command deletes all processed messages of
  59. the report message class from the topmost folder of the default
  60. message store.
  61.  
  62. Client:
  63. When launched, the client app searches its inbox for a request
  64. message. Then it displays a form based on the data in the message.
  65. When user is done filling out the form, the information is sent to the
  66. server in a report message.
  67.  
  68. How it works:
  69. The request message contains three named properties:
  70. +  "NumReportCategories" - number of report categories (integer)
  71. +  "ReportCategories" - report categories (multi-valued string)
  72. +  "PayPeriod"  - pay period (date)
  73. The report message contains all of the request message named
  74. properties plus one multi-valued property (array of doubles) for every
  75. report category. Names of these properties are "ReportedTimek", k = 1,
  76. 2, ... NumberOfCategories. For example, the name of the data property
  77. corresponding to the first report category, which name is the first
  78. element of the array stored in the report categories property, is
  79. "ReportedTime1".
  80.  
  81.  
  82. Issues to consider:
  83. Following is a list of some of questions that everybody who writes an
  84. application similar to this one has to face. Some of them are solved
  85. in this sample, for others a possible solution is proposed.
  86.  
  87. 1. If there is more than one request message in user's inbox, the server
  88. app can display a listbox showing pay-period and time received for
  89. each message and let user choose the one that he wants to use.
  90. 2. If a user unintentionally sends more than one message for the same pay
  91. period, the client app can remove the request message after it is used,
  92. but then users will not be able to resubmit report in case of an
  93. error.
  94. 3. Suppose a user made a mistake in his report and wants to resubmit it.
  95. The server can use the latest report message from the user for a given
  96. report period.. Whoever runs the server app has to make sure that  he
  97. waits until all the report messages are received or regenerates the
  98. report after new submissions. This would also be a solution for 2. On
  99. the client side: after reading a request message, client can scan the
  100. SentMail folder and if it finds a message for the requested pay period,
  101. it intializes the form with the data from the message.
  102. 4. If some report messages are lost either in transmission or due to
  103. corruption of the store on the server side, "Remind" button on the
  104. Report dialog can be used to send out new requests to the users whose
  105. reports were lost. If the solution for 3. is implemented then the only
  106. thing the user will have to do after launching the form is to hit the
  107. "Send" button.
  108. 5. If a report from somebody not on the user list is received, the server
  109. can either ignore it or give the list owner an option to add the user
  110. to the list.
  111. 6. Validating pay period. In this sample the validation is performed in
  112. frmCalendar.ValidatePayPeriod function.  To change the definition of
  113. the pay period modify the logic of this function.
  114.  
  115.